﻿
Public Class Sheet1

    Private Sub Sheet1_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup

    End Sub

    Private Sub Sheet1_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

    End Sub

    'Simple databinding requires you to manually indicate when an update to the spreadsheet should be updated in the
    'databound object.  Otherwise updates never reach the databound controls and the databound value is restored in the
    'display.  
    'To make something that isn't writable writable use this: ListForecast.DataBindings("Value").WriteValue()
    ' For the actual sales values this works since that grid is read only. 
    Private Sub ListForecastObject_Change(ByVal targetRange As Microsoft.Office.Interop.Excel.Range, ByVal changedRanges As Microsoft.Office.Tools.Excel.ListRanges) Handles ListForecast.Change

    End Sub

    Private Sub ListSales_Change(ByVal targetRange As Microsoft.Office.Interop.Excel.Range, ByVal changedRanges As Microsoft.Office.Tools.Excel.ListRanges) Handles ListSales.Change
        ListSales.DataBindings("Value").ReadValue()
        'Globals.ThisWorkbook.salesDataTable.RejectChanges()
    End Sub

End Class
